<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>注册</title>
        <meta name="keywords" content="">
        <meta name="content" content="">
        <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
        <link type="text/css" rel="stylesheet" href="__ROOT__/static/css/login.css">
        <script type="text/javascript" src="__ROOT__/static/js/jquery.min.js"></script>
        <script>
            var last = null;
            $(document).ready(function () {
                $("#yan").click(function () {
                    var now = Date.now();
                    var u = $('#user').val();
                    var el = $('#email').val();
                    if (u == '') {
                        alert('账号不能为空！');
                        return;
                    }
                    if (el == '') {
                        alert('邮箱不能为空！');
                        return;
                    }
                    if (last != null) {
                        if ((now - last) < 60000) {
                            last = now;
                            alert('请歇息一会！');
                            return;
                        } else {
                            last = now;
                        }
                    }else{
                        last = Date.now();
                    }
                    $.post("__ROOT__/Home/User/verify",
                            {
                                user: u,
                                email: el
                            },
                            function (data, status) {

                                if (data == 0) {
                                    alert('请联系管理员');
                                } else if (data == 1) {
                                    alert('邮箱格式错误');
                                } else if (data == 2) {
                                    alert('该帐号已存在！');
                                } else if (data == 3) {
                                    alert('该邮箱不正确，请填写正确邮箱，不建议使用QQ邮箱！');
                                } else if (data == 4) {
                                    alert('申请验证码成功，验证码有效期为两分钟！')
                                }
                            });
                });
            });
        </script>
    </head>
    <body class="login_bj" >

        <div class="zhuce_body">
            <div class="zhuce_kong">
                <div class="zc">
                    <div class="bj_bai">
                        <h3>欢迎注册</h3>
                        <form action="__SELF__" method="post">
                            <input id="user" name="user" type="text" class="kuang_txt phone" placeholder="账号">
                            <input id="email" name="email" type="email" required class="kuang_txt email" placeholder="邮箱">
                            <input name="pwd" type="password" class="kuang_txt possword" placeholder="密码">
                            <input name="code" type="text" class="kuang_txt yanzm" placeholder="验证码" style="width: 80px;">
                            <button id="yan" type="button" class="kuang_txt" style="width: 120px;padding-left: 10px;outline: 0">获取验证码</button>
                            <div>
                                <span>已有账号？<a href="Index.html"><span class="lan">立即登录</span></a></span>
                            </div>
                            <input name="注册" type="submit" class="btn_zhuce" value="注册">

                        </form>
                    </div>
                </div>
            </div>

        </div>


    </body>
</html>